<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
		body,
		html {
			width: 100%;
			height: 100%;
			margin: 0;
			font-family: "微软雅黑";
		}

		#allmap {
			height: 100%;
			width: 100%;
		}

		#r-result {
			width: 100%;
			font-size: 14px;
		}
	</style>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=2XLiG7HKXpPUo2oE74iWFZIrdPXpIPNV"></script>
	<title>城市名定位</title>
	<link th:href="@{/showstatic/css/details.css}" type="text/css" rel="stylesheet"/>
	<link th:href="@{/showstatic/js/layer-v3.0.3/layer/mobile/need/layer.css}" rel="stylesheet" type="text/css"/>
	<link th:href="@{/showstatic/layui/css/layui.css}" type="text/css" rel="stylesheet"/>
	<script type="text/javascript" th:src="@{/showstatic/js/jquery-1.7.2.min.js}"></script>
	<script type="text/javascript" th:src="@{/showstatic/js/phone.js}"></script>
	<script type="text/javascript" th:src="@{/showstatic/js/layer-v3.0.3/layer/layer.js}"></script>
	<script type="text/javascript" th:src="@{/showstatic/layui/layui.js}"></script>
</head>
<body>
	<div>
		<a class="footer" href="javascript:history.go(-1)">返回</a>
	</div>
	<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
	var LocString = String(window.document.location.href);

	function GetQueryString(name) {
		var rs = new RegExp("(^|)" + name + "=([^&]*)(&|$)", "gi").exec(LocString),
			tmp;
		if (tmp = rs) {
			return decodeURI(tmp[2]);
		}
		return "";
	}

	var longitude = GetQueryString("longitude");
	var latitude = GetQueryString("latitude");
	// 百度地图API功能
	var map = new BMap.Map("allmap");
	map.centerAndZoom(new BMap.Point(104.072366,30.662801), 18);
	map.enableScrollWheelZoom(true);

	// 用经纬度设置地图中心点

	if (longitude != "" && latitude != "") {
		map.clearOverlays();
		var new_point = new BMap.Point(longitude, latitude);
		var marker = new BMap.Marker(new_point); // 创建标注
		map.addOverlay(marker); // 将标注添加到地图中
		map.panTo(new_point);
	}else{
		alert("参数错误！");
	}
</script>
